<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<canvas width='600' height='400' id='cas'></canvas>
</body>
<script>
    //获取画布
    var cas = document.getElementById('cas');
    //调用方法 获得绘图工具
    var ctx = cas.getContext('2d');
    //设置起始点
    ctx.moveTo(100, 100);
    //绘制线段
    //描点
    ctx.stroke();

</script>
</html>